package com.example.zyh.mapper;



import com.example.zyh.pojo.Shop;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface ShopMapper {
    @Select("select * from shop")
    public List<Shop> select();
    @Insert("INSERT INTO shop (`name`, `username`, `sex`, `area`, `style`)" +
            "VALUES(#{name}, #{username},#{sex},#{area},#{style})")
    public void addShop(Shop shop);
    @Delete("DELETE FROM shop WHERE `id` = #{id}")
    public void deleteShop(int id);
    @Update("UPDATE shop SET `name` = #{name} , `username` = #{username} , `sex` = #{sex} , `area` = #{area} , `style` = #{style} WHERE `id` = #{id}")
    public void updateShop(Shop shop);
    @Select("SELECT * FROM shop where name=#{name} or style=#{style}")
    public List<Shop> selectlike(Shop shop);
}
